package cn.lanqiao.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RequestMapping("/api/admin")
@RestController
public class AdminController {

	@Autowired
	private cn.lanqiao.service.AdminService adminService;
	
	
	//获取用户数
	@ GetMapping("/gettotal")
	public Map<String,Object> get( ){
		Map<String,Object>  map = new HashMap<String,Object>();
		map = adminService.totalUser();
		if(map.size()>0) {
			map.put("status", 200);
			map.put("statusText","获取数据成功 ");
		}else {
			map.put("status", 0);
			map.put("statusText","获取数据失败 ");
		}
		return map;
	}
<<<<<<< HEAD
	//获取用户数
		@ GetMapping("/totalnumber")
		public Map<String,Object> getItem( ){
			Map<String,Object>  map = new HashMap<String,Object>();
			map = adminService.itemNumber();
			if(map.size()>0) {
				map.put("status", 200);
				map.put("statusText","获取数据成功 ");
			}else {
				map.put("status", 0);
				map.put("statusText","获取数据失败 ");
			}
			return map;
		}	
=======
	
	//获取用户数
	@ GetMapping("/totalnumber")
	public Map<String,Object> getItem( ){
		Map<String,Object>  map = new HashMap<String,Object>();
		map = adminService.itemNumber();
		if(map.size()>0) {
			map.put("status", 200);
			map.put("statusText","获取数据成功 ");
		}else {
			map.put("status", 0);
			map.put("statusText","获取数据失败 ");
		}
		return map;
	}	
	
>>>>>>> a0db96222127504221d4dc4b4cc0e85cb062efa0
}
